<template>
  <div
    :class="dataOptions.dvModel == 1 ? 'sm-app-data-ly' : 'sm-app-data-super'"
    :style="dataOptions.dvContentStyle"
  >
    <div class="dv-wrapper back">
      <header
        class="dv-main-font"
        :style="{ 'font-size': dataOptions.dvMainFontSize }"
      >
        总数
      </header>
      <section class="dv-group-layout">
        <div
          class="dv-useal-font"
          :style="{ 'font-size': dataOptions.dvUsealFontSize }"
        >
          <div>咨询量(条)</div>
          <div class="dv-font" :style="{ 'font-size': dataOptions.dvFontSize }">
            {{ addThousandsSeparator(info.num_question || 0) }}
          </div>
        </div>
        <div
          class="dv-useal-font"
          :style="{ 'font-size': dataOptions.dvUsealFontSize }"
        >
          <div>办结率</div>
          <div class="dv-font" :style="{ 'font-size': dataOptions.dvFontSize }">
            {{ addThousandsSeparator(info.num_bjv || 0) }}%
          </div>
        </div>
        <div
          class="dv-useal-font"
          :style="{ 'font-size': dataOptions.dvUsealFontSize }"
        >
          <div>咨询差评率</div>
          <div class="dv-font" :style="{ 'font-size': dataOptions.dvFontSize }">
            {{ addThousandsSeparator(info.num_zxcpl || 0) }}%
          </div>
        </div>
      </section>
    </div>

    <div class="dv-wrapper noright">
      <header
        class="dv-minor-font"
        :style="{ 'font-size': dataOptions.dvMinorFontSize }"
      >
        其中：人工
      </header>
      <section class="dv-group-layout">
        <div
          class="dv-useal-font"
          :style="{ 'font-size': dataOptions.dvUsealFontSize }"
        >
          <div>咨询量(条)</div>
          <div class="dv-font" :style="{ 'font-size': dataOptions.dvFontSize }">
            {{ addThousandsSeparator(info.num_rg_zxl || 0) }}
          </div>
        </div>
        <div
          class="dv-useal-font"
          :style="{ 'font-size': dataOptions.dvUsealFontSize }"
        >
          <div>办结率</div>
          <div class="dv-font" :style="{ 'font-size': dataOptions.dvFontSize }">
            {{ addThousandsSeparator(info.num_rg_bjl || 0) }}%
          </div>
        </div>
        <div
          class="dv-useal-font"
          :style="{ 'font-size': dataOptions.dvUsealFontSize }"
        >
          <div>咨询差评率</div>
          <div class="dv-font" :style="{ 'font-size': dataOptions.dvFontSize }">
            {{ addThousandsSeparator(info.num_rg_zxcpl || 0) }}%
          </div>
        </div>
      </section>
    </div>

    <div class="dv-wrapper noleft">
      <header
        class="dv-minor-font"
        :style="{ 'font-size': dataOptions.dvMinorFontSize }"
      >
        机器人
      </header>
      <section class="dv-group-layout">
        <div
          class="dv-useal-font"
          :style="{ 'font-size': dataOptions.dvUsealFontSize }"
        >
          <div>咨询量(条)</div>
          <div class="dv-font" :style="{ 'font-size': dataOptions.dvFontSize }">
            {{ addThousandsSeparator(info.num_jqr_zxl || 0) }}
          </div>
        </div>
        <div
          class="dv-useal-font"
          :style="{ 'font-size': dataOptions.dvUsealFontSize }"
        >
          <div>办结率</div>
          <div class="dv-font" :style="{ 'font-size': dataOptions.dvFontSize }">
            {{ addThousandsSeparator(info.num_jqr_bjl || 0) }}%
          </div>
        </div>
        <div
          class="dv-useal-font"
          :style="{ 'font-size': dataOptions.dvUsealFontSize }"
        >
          <div>咨询差评率</div>
          <div class="dv-font" :style="{ 'font-size': dataOptions.dvFontSize }">
            {{ addThousandsSeparator(info.num_jqr_zccpl || 0) }}%
          </div>
        </div>
      </section>
    </div>
  </div>
</template>

<script setup>
import { addThousandsSeparator } from "@/utils/formatter.js";

const props = defineProps({
  info: { type: Object, default: () => ({}) },
  dataOptions: {
    type: Object,
    default: () => {
      return {
        dvModel: 1,
        dvContentStyle: "",
        dvUsealFontSize: "0.14rem",
        dvFontSize: "0.24rem",
      };
    },
  },
});
</script>
<style lang="less" scoped>
.dv-sub-font {
  font-family: HarmonyOS_SansSC_Medium;
  font-weight: 400;
  font-size: 0.24rem;
  color: #111;
  letter-spacing: 0;
}

.dv-main-font {
  font-family: HarmonyOS_SansSC_Medium;
  font-weight: 500;
  font-size: 0.16rem;
  color: #1d2129;
  letter-spacing: 0;
  margin-top: 0.16rem;
  margin-bottom: 0.14rem;
}
.back {
  border-top-left-radius: 0.04rem;
  border-bottom-left-radius: 0.04rem;
  background-color: #f2f7ff !important;
}
.noright {
  background-color: #fff;
  border: 1px solid #e6ebf5;
  border-right: none !important;
}
.noleft {
  border-top-right-radius: 0.04rem;
  border-bottom-right-radius: 0.04rem;
  background-color: #fff;
  border: 1px solid #e6ebf5;
  border-left: none !important;
}
.dv-wrapper {
  background-color: #fff;
  border: 1px solid #e6ebf5;
  margin-bottom: 0.2rem;
  .dv-group-layout {
    display: flex;
    .dv-content-font {
      // font-family: D-DIN-Bold;
      font-weight: 400;
      font-size: 0.28rem;
      color: #ffffffb3;
      letter-spacing: 0;
      margin-right: 0.4rem;
      &:last-child {
        margin-right: 0;
      }
      .dv-error-font,
      .dv-normal-font {
        font-size: 0.32rem;
        // font-family: D-DIN-Bold;
        font-weight: 700;
        margin-left: 0.16rem;
      }
      .dv-error-font {
        color: #f53f3f;
      }
      .dv-normal-font {
        color: #00b675;
      }
    }
    .dv-useal-font {
      font-family: HarmonyOS_SansSC_Medium;
      font-weight: 400;
      font-size: 0.24rem;
      color: #4e5969;
      letter-spacing: 0;
      // width: 0.88rem;
      margin-right: 0.2rem;
      &:last-child {
        margin-bottom: 0;
        margin-right: 0;
      }
      .dv-font {
        font-family: HarmonyOS_SansSC_Medium;
        font-weight: 500;
        font-size: 0.18rem;
        margin-top: 0.06rem;
        color: #1d2129;
      }
    }
  }
  &:last-child {
    margin-bottom: 0;
  }
}
// .dv-wrapper:hover {
//   background-color: #f2f7ff;
// }

.dv-nowrapper {
  display: flex;
  flex-wrap: nowrap;
  .dv-content-font {
    margin-right: 0;
  }
}

.dv-minor-font {
  font-family: HarmonyOS_SansSC_Medium;
  font-weight: 500;
  font-size: 0.14rem;
  color: #1d2129;
  letter-spacing: 0;
  margin-top: 0.16rem;
  margin-bottom: 0.14rem;
}

.sm-app-data-ly {
  text-align: left;
  width: 4.2rem;
  padding-right: 0.16rem;

  .dv-wrapper {
    padding-bottom: 0.16rem;
    margin-bottom: 0.16rem;

    &:first-child {
      box-shadow: inset 0 -1px 0 0 rgba(108, 128, 151, 0.5);
    }

    .dv-useal-font {
      &:not(:last-child) {
        margin-right: 0.16rem;
      }

      .dv-font {
        margin-top: 0.05rem;
      }
    }
  }
}

.sm-app-data-super {
  text-align: left;
  width: 4.2rem;
  padding-right: 0.16rem;
  width: 100%;

  .dv-wrapper {
    width: 50%;
    padding-bottom: 0.16rem;
    margin-bottom: 0.2rem;

    &:nth-child(1) {
      padding-left: 0.2rem;
      // border-right: 1px solid rgba(16, 85, 163, 0.5);
    }

    &:nth-child(2) {
      padding-left: 0.2rem;
    }
    &:nth-child(3) {
      padding-left: 0.2rem;
    }
    .dv-font {
      padding-top: 0.05rem;
    }
  }
}
</style>
